package cn.epsilon3.configBean;

import cn.epsilon3.annotation.E3Config;
import cn.epsilon3.constant.ClassTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 多因子配置注入
 *
 * @date 2023-08-16
 * @author epsilon3
 */
@Data
@Component
@ConfigurationProperties(
        prefix = "epsilon3.config.security.fa"
)
public class Initializing2FAConfig {

    /**
     * 2fa开启开关
     */
    @E3Config(suffixName = "enable",
    defaultValue = "false",
    type = ClassTypeEnum.BOOLEAN,
    comment = "是否开启2FA")
    private boolean enable;

    /**
     * 颁发系统名称
     */
    @E3Config(suffixName = "issuer",
            defaultValue = "Epsilon3",
            type = ClassTypeEnum.STRING,
            comment = "颁发系统名称")
    private String issuer;

    /**
     * 二维码图片宽度
     */
    @E3Config(suffixName = "pngWidth",
            defaultValue = "300",
            type = ClassTypeEnum.INTEGER,
            comment = "二维码图片宽度")
    private int pngWidth;

    /**
     * 二维码图片高度
     */
    @E3Config(suffixName = "pngHeight",
            defaultValue = "300",
            type = ClassTypeEnum.INTEGER,
            comment = "二维码图片高度")
    private int pngHeight = 300;
}
